package com.mycompany.myapp.service;

import com.mycompany.myapp.domain.mongodb.DemoEntity;
import com.mycompany.myapp.repository.mongodb.DemoRepository;
import org.springframework.stereotype.Service;
import org.springframework.cache.CacheManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.transaction.annotation.Transactional;

@Service
public class DemoService {

    private final Logger log = LoggerFactory.getLogger(DemoService.class);


    private final CacheManager cacheManager;

    private final DemoRepository demoRepository;


    public DemoService(CacheManager cacheManager, DemoRepository demoRepository) {
        this.cacheManager = cacheManager;
        this.demoRepository = demoRepository;
    }

    @Transactional
    public void createRecord(DemoEntity demoEntity){
        demoRepository.insert(demoEntity);
        int a = 5/0;
    }





}
